<template>
	<view class="searchPage">
		<headerinfo></headerinfo>

		<view class="width60">
			<u-navbar title="纪念馆" :autoBack="true" leftIconColor="#fff" :bgColor="bgColor"
				:titleStyle="titleStyle"></u-navbar>

			<view class="jinianlist">
				<view class="list" @click="toInfo(item)" v-for="(item,index) in list" :key="index">
					<image :src="item.museumStyleImageUrl" mode="aspectFill"></image>
					<view class="text">
						<view class="name">
							{{item.museumName}}
						</view>
						<view class="time">
							建馆时间：{{item.dataUpdateTime.substring(0,10)}}
						</view>
						<view class="time">
							建馆人：{{item.museumBuilder}}
						</view>
						<view class="" style="display: flex;">
							<view class="btn" @click.stop="toEdit(item)">
								编辑
							</view>
							<view class="btn" style="margin-left: 20rpx;">
								进入
							</view>
						</view>

					</view>
				</view>
			</view>
		</view>

		<!-- <view class="create" @click="toCreate">
			建馆
		</view> -->

	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				bgColor: '#de4849',
				titleStyle: {
					color: '#fff'
				},
				docId: '', //家庭id
				list: []
			};
		},
		onShow(e) {
			this.getData()
		},
		methods: {
			getData() {
				this.$api.museumgetAllMuseum().then(res => {
					console.log(res)
					this.list = res
				})
			},
			toCreate() {
				uni.navigateTo({
					url: '/pagesobit/obit/create'
				})
			},
			toEdit(item) {
				console.log(item.docId)
				uni.navigateTo({
					url: `/pagesobit/obit/create?id=${item.docId}`
				})
			},
			toInfo(item) {
				uni.navigateTo({
					url: `/pagesobit/obit/citang?id=${item.docId}`
				})
			}
		}
	};
</script>


<style lang="scss" scoped>
	.searchPage {
		margin: 0 auto;
		height: 100vh;
		background-image: url('https://cdn-oss.familylove.online/user/kmh/image/1731819466275_48704521.jpg');
		background-size: 100% 100%;
		overflow-y: scroll;
	}

	.create {
		width: 600rpx;
		height: 80rpx;
		background: #de4849;
		color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 30rpx auto;
		border-radius: 20rpx;
	}

	.jinianlist {
		width: 100%;
		margin: 0 auto;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		background-color: #fff;
		border-top: 1px solid #e4e4e4;

		.list {
			width: 33%;
			height: 320rpx;
			background-size: 100% 100%;
			background-color: #fff;
			position: relative;
			padding-left: 330rpx;
			display: flex;
			justify-content: center;
			flex-direction: column;

			image {
				position: absolute;
				width: 230rpx;
				left: 67rpx;
				height: 210rpx;
			}

			.text {
				font-size: 28rpx;

				.name {
					color: #500;
					font-weight: bold;
					font-size: 34rpx;
				}
			}

			.btn {
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: center;
				width: 120rpx;
				color: #fff;
				background-color: #b66803;
				padding: 10rpx;
				text-align: center;
				border-radius: 5px;
			}
		}
	}
</style>